package myset;

import java.util.TreeSet;

public class A03_TreeSetDemo5 {
    public static void main(String[] args) {
        //创建集合
        TreeSet<Student3> ts = new TreeSet<>();
        //添加学生
        ts.add(new Student3("zhangsan",19,100,120,99));
        ts.add(new Student3("lisi",20,99,111,120));
        ts.add(new Student3("wangwu",18,111,111,99));
        ts.add(new Student3("zhaoliu",22,120,99,89));
        ts.add(new Student3("xiaoxixi",21,90,99,130));
        ts.add(new Student3("xiaoxixi",21,91,99,130));

        for (Student3 t : ts) {
            System.out.println(t+" "+t.getSum());
        }
    }
}
